package main

/**
 *
 * @param A int整型一维数组
 * @return int整型二维数组
 */
func subsets(A []int) [][]int {
	// write code here
	n := len(A)
	if n == 0 {
		return [][]int{{}}
	}

	res := subsets(A[:n-1])

	ln := len(res)
	for i := 0; i < ln; i++ {
		// 深拷贝
		tmp := make([]int, len(res[i]))
		copy(tmp, res[i])
		res = append(res, append(tmp, A[n-1]))
	}
	return res
}
